Aspect Weaving with C# and .NET
نویسنده
چکیده
Since current object oriented programming languages don’t have existing support for aspects, aspects are often supported through language extensions [1, 2]. Another approach is to use the existing language to encapsulate aspect behaviors, and provide an additional language to express cross cutting statements [3-5]. Finally, other systems [6]including the one described in this paper use features of the existing language to specify aspect behavior and cross cutting. This paper presents a prototype weaver called AOP.NET that demonstrates the feasibility of supporting aspect oriented programming in C# without the need for language extensions, or a cross cutting statement file. All of the information related to supporting AOP including the cross cutting statements is contained in the aspect declaration. The cross cutting statements are expressed using a language feature called attributes which are used to annotate methods, fields and classes with meta data in languages targeting the Common Language Runtime (CLR) such as C#. Since attributes are supported in all CLR languages it should be possible to maintain .NET language independence with this approach [3, 5]. AOP.NET demonstrates the feasibility of static and transparent dynamic weaving in .NET. Unlike other .NET dynamic weavers, no changes are required to the source code of clients of functional components for dynamic weaving, the same weaving engine is used in both a static tool and dynamic weaving run time host, and it is implemented completely in C#.
منابع مشابه
AOP Support for C#
We have extended the C# compiler available under Microsoft’s Shared Source Common Language Infrastructure (SSCLI) to facilitate Aspect Oriented Programming. The resulting compiler targets Microsoft .NET architecture. Our implementation introduces new ideas into the aspect language and the aspect-weaving mechanism. Our AOP extensions emulate AspectJ programming model and augment it with construc...
متن کاملSourceWeave.NET: Cross-Language Aspect-Oriented Programming
Aspect-Oriented Programming (AOP) addresses limitations in the Object-Oriented (OO) paradigm relating to modularisation of crosscutting behaviour. In AOP, crosscutting behaviour is expressed as aspects that are integrated with a base program through a weaving process. Many language-specific AOP models already exist, requiring the programmer to work with a single language for base and aspect pro...
متن کاملSupport for Metadata-driven Selection of Run-time Services in .NET is Promising but Immature
The .NET Framework allows developers to add run-time services to their classes by specifying them in metadata. This metadata-driven service selection is a very powerful and promising mechanism, closely related to ideas developed in the Aspect-Oriented Programming community. Interestingly, the .NET framework supports both services implemented by weaving and services implemented by interception. ...
متن کاملCoupling Availability and Efficiency for Aspect Oriented Runtime Weaving Systems
Performance and availability are two critical requirements of today’s systems. Current dynamic AOP approaches have addressed the performance issue from one specific dimension: the performance of code after the weaving process. Other performance factors may have a great impact on overall system performance. This includes performance of the weaving process itself and also system availability in s...
متن کاملFrom Weaving Schemes to Weaving Patterns ∗
Coming out from the process functional paradigm and using PFL – a process functional language, a generalized approach to weaving at the micro-structural level is presented. Exploiting the application of processes and PFL reflection property, we develop a generalized weaving scheme and we express it in the form of weaving pattern. Different specializations and extensions of weaving patterns occu...
متن کامل